﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ProductStoreDetail.aspx.cs"
    Inherits="Manager_ProductStore_ProductStoreDetail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Quan ly kho</title>
    <link href="../../Pub/Css/BodyStyles.css" rel="stylesheet" type="text/css" />
    <link href="../../Pub/Css/AdminStyles.css" rel="stylesheet" type="text/css" />
    <link href="../../Pub/Css/CalendarStyles.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript">
      function Picker1_onSelectionChanged(sender, eventArgs)
      {
        cldStart.SetSelectedDate(Picker1.GetSelectedDate());   
        cldStart.Show();
      }
      function cldStart_onSelectionChanged(sender, eventArgs)
      {
      
            var fromDate = cldStart.GetSelectedDate();
            var toDate = cldEnd.GetSelectedDate();
            Picker1.SetSelectedDate(fromDate);            
           /* if(fromDate > toDate)
            {
              Picker2.SetSelectedDate(fromDate);
              cldEnd.SetSelectedDate(fromDate);
            }  */             
      }
      
      function Picker2_onSelectionChanged(sender, eventArgs)
      {
        cldEnd.SetSelectedDate(Picker2.GetSelectedDate());
        cldEnd.Show();
      }
      function cldEnd_onSelectionChanged(sender, eventArgs)
      {         
            var fromDate = cldStart.GetSelectedDate();
            var toDate = cldEnd.GetSelectedDate();
            Picker2.SetSelectedDate(toDate);            
           /* if(fromDate > toDate)
            {
              Picker1.SetSelectedDate(toDate);
              cldStart.SetSelectedDate(toDate);
            }         */           
      }
    //]]>
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <table bgcolor="#f7ffe4" border="1" bordercolor="#407db3" cellpadding="2" cellspacing="0"
            style="width: 100%; border-collapse: collapse">
            <tr>
                <td align="center" nowrap="nowrap" width="5%">
                    <asp:Button ID="btnSearch" runat="server" CssClass="cssButton" OnClick="btnSearch_Click"
                        Text="Tìm kiếm" Width="81px" />
                    <input id="Button1" runat="server" class="cssButton" onclick="javascript:window.close()"
                        style="width: 81px" type="button" value="Quay lại" /></td>
                <td class="td_Title" nowrap="nowrap" width="5%">
                    <asp:Label ID="Label5" runat="server" Text="Ngày đặt hàng:"></asp:Label>
                </td>
                <td colspan="4" nowrap="nowrap" align="left" valign="middle">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <td>
                                </td>
                                <td align="center">
                                    <ComponentArt:Calendar ID="Picker1" runat="server" ClientSideOnSelectionChanged="Picker1_onSelectionChanged"
                                        ControlType="Picker" PickerCssClass="picker" PickerCustomFormat="dd/MM/yyyy"
                                        PickerFormat="Custom">
                                    </ComponentArt:Calendar>
                                </td>
                                <td>
                                    &nbsp;
                                    <img id="calendar_start_button" alt="" class="calendar_button" height="22" onclick="cldStart .SetSelectedDate(Picker1.GetSelectedDate());cldStart .Show();"
                                        src="../../Images/Icon/btn_calendar.gif" width="25" />
                                </td>
                                <td align="center" style="width: 2px">
                                    &nbsp;~&nbsp;</td>
                                <td align="center">
                                    <ComponentArt:Calendar ID="Picker2" runat="server" ClientSideOnSelectionChanged="Picker2_onSelectionChanged"
                                        ControlType="Picker" PickerCssClass="picker" PickerCustomFormat="dd/MM/yyyy"
                                        PickerFormat="Custom">
                                    </ComponentArt:Calendar>
                                </td>
                                <td>
                                    &nbsp;
                                    <img id="calendar_end_button" alt="" class="calendar_button" height="22" onclick="cldEnd.SetSelectedDate(Picker2.GetSelectedDate());cldEnd.Show();"
                                        src="../../Images/Icon/btn_calendar.gif" width="25" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
                <td class="td_Title" nowrap="nowrap" width="5%">
                    Kho:</td>
                <td align="left" colspan="1" nowrap="nowrap" valign="middle">
                    <asp:DropDownList ID="ddlStore" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlStore_SelectedIndexChanged">
                    </asp:DropDownList></td>
            </tr>
        </table>
        <asp:GridView ID="grv_Master" runat="server" CellPadding="2" BorderColor="#407DB3"
            BorderWidth="1px" AutoGenerateColumns="False" Width="100%" OnRowDataBound="grv_Master_RowDataBound" ShowFooter="True">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <%#Container.DataItemIndex + 1%>
                    </ItemTemplate>
                    <HeaderTemplate>
                        STT
                    </HeaderTemplate>
                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                    <HeaderStyle CssClass="cssBorderGrv" Width="2%" Wrap="False" />
                </asp:TemplateField>
                <asp:BoundField DataField="DateStore" HeaderText="Ng&#224;y hệ thống" >
                    <HeaderStyle CssClass="cssBorderGrv" Width="5%" Wrap="False" />
                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                </asp:BoundField>     
               <asp:TemplateField>
                    <HeaderTemplate>
                       Giá gốc
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("OriginalPrice") %>' ></asp:Label>
                         <asp:Label ID="Label1" runat="server" Text='<%# Eval("OriginalRate") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Right" />
                    <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="3%" Wrap="False" />
                </asp:TemplateField>                           
                <asp:TemplateField>
                    <HeaderTemplate>
                        Số lượng nhập
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblInput" runat="server" Text='<%# Eval("Input") %>' ForeColor="Blue"></asp:Label>
                    </ItemTemplate>
                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                    <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="3%" Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        Số lượng xuất
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblOutput" runat="server" Text='<%# Eval("Output") %>' ForeColor="Red"></asp:Label>
                    </ItemTemplate>
                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                    <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="3%" Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        Tổng số lượng trong kho
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblTotal" runat="server" Text='' Font-Bold="true"></asp:Label>
                    </ItemTemplate>
                    <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Font-Bold="True" BackColor="Aqua" />
                    <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="5%" Wrap="False" />
                </asp:TemplateField>
            </Columns>
            <RowStyle CssClass="gvRowStyle" />
            <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
            <HeaderStyle CssClass="gvHeader" />
            <FooterStyle CssClass="gvHeader"  BackColor="PaleGoldenrod"  HorizontalAlign="Center" ForeColor="Blue" />
            <PagerStyle CssClass="gvPaggingStyle" />
        </asp:GridView>
        <ComponentArt:Calendar ID="cldStart" runat="server" AllowMonthSelection="False" AllowMultipleSelection="False"
            AllowWeekSelection="False" CalendarCssClass="calendar" CalendarTitleCssClass="title"
            ClientSideOnSelectionChanged="cldStart_onSelectionChanged" ControlType="Calendar"
            DayCssClass="day" DayHeaderCssClass="dayheader" DayHoverCssClass="dayhover" DayNameFormat="Full"
            MonthCssClass="month" NextImageUrl="../../Images/Icon/cal_nextMonth.gif" NextPrevCssClass="nextprev"
            OtherMonthDayCssClass="othermonthday" PopUp="Custom" PopUpExpandControlId="calendar_start_button"
            PrevImageUrl="../../Images/Icon/cal_prevMonth.gif" SelectedDate="2008-11-17"
            SelectedDayCssClass="selectedday" SelectMonthCssClass="selector" SelectMonthText="¤"
            SelectWeekCssClass="selector" SelectWeekText="»" SwapDuration="300" SwapSlide="Linear"
            VisibleDate="2008-11-17">
        </ComponentArt:Calendar>
        <ComponentArt:Calendar ID="cldEnd" runat="server" AllowMonthSelection="False" AllowMultipleSelection="False"
            AllowWeekSelection="False" CalendarCssClass="calendar" CalendarTitleCssClass="title"
            ClientSideOnSelectionChanged="cldEnd_onSelectionChanged" ControlType="Calendar"
            DayCssClass="day" DayHeaderCssClass="dayheader" DayHoverCssClass="dayhover" DayNameFormat="Full"
            MonthCssClass="month" NextImageUrl="../../Images/Icon/cal_nextMonth.gif" NextPrevCssClass="nextprev"
            OtherMonthDayCssClass="othermonthday" PopUp="Custom" PopUpExpandControlId="calendar_end_button"
            PrevImageUrl="../../Images/Icon/cal_prevMonth.gif" SelectedDate="2008-11-17"
            SelectedDayCssClass="selectedday" SelectMonthCssClass="selector" SelectMonthText="¤"
            SelectWeekCssClass="selector" SelectWeekText="»" SwapDuration="300" SwapSlide="Linear"
            VisibleDate="2008-11-17">
        </ComponentArt:Calendar>
    </form>
</body>
</html>
